package com.vhall.component.service.redpacket.common;

import java.math.BigDecimal;

/**
 * 常量类
 *
 * @author zhangtao
 */
public final class RedpacketConstants {

    private RedpacketConstants() {
        throw new IllegalStateException("Utility class");
    }

    public static final int DELETED = 1;
    public static final int NOT_DELETED = 0;

    public static final String CHANNEL_WXPAY = "WEIXIN";
    public static final String CHANNEL_ALIPAY = "ALIPAY";

    /**
     * 微信端支付
     */
    public static final String SRV_CODE_JSAPI = "JSAPI";
    /**
     * 扫码支付
     */
    public static final String SRV_CODE_QR_PAY = "QR_PAY";
    /**
     * 收银台支付
     */
    public static final String SRV_CODE_CASHIER = "CASHIER";
    /**
     * H5_PAY
     */
    public static final String SRV_CODE_H5_PAY = "H5_PAY";

    /**
     * 表情类型为红包
     */
    public static final Integer GIFT_RED_PACKET = 1;

    /**
     * 表情类型为礼品
     */
    public static final Integer GIFT = 2;

    /**
     * 是否软删除 0：物理删除
     */
    public static final Integer SOFT_DELETE = 0;

    public static final String SORT_ASC = "asc";

    public static final String SORT_DESC = "desc";

    /**
     * 红包明细 列表
     * old-> Queue:RedPacket:Children:
     */
    public static final String QUEUE_RED_PACKET_PREFIX = "comp:redpacket:queue:child:";

    /**
     * old -> queue:names
     */
    public static final String QUEUE_NAMES_KEY = "comp:redpacket:queue:names";

    /**
     * Queue:RedPacket:Record
     */
    public static final String QUEUE_RED_PACKET_RECORD = "comp:redpacket:queue:record";

    /**
     * old -> RedPacket:User:AppId: 失效:(2day)
     */
    public static final String RED_PACKET_USER_BY_APP_ID = "comp:redpacket:user:appid:";

    /**
     * 根据领取金额分配的红包详情记录 失效:(2day)
     */
    public static final String RED_RECORDS_ORDER_BY_AMOUNT_RANKING = "comp:redpacket:records:%s:rank";

    /**
     * old -> RedRecords:%s:Time
     */
    public static final String RED_RECORDS_ORDER_BY_TIME = "comp:redpacket:records:%s:time";

    /**
     * app信息缓存的key名
     */
    public static final String APP_SETTING_BY_APP_ID = "comp:redpacket:app:";

    /**
     * old -> RedPacket:Info:
     */
    public static final String REDPACKET_INFO = "comp:redpacket:info:";

    /**
     * Cache:RedPacket:Unlock:
     */
    public static final String CACHE_RED_PACKET_UNLOCK_KEY = "comp:redpacket:unlock:";
    /**
     * Count:RedPacket:Join:SourceId:
     */
    public static final String COUNT_RED_PACKET_JOIN_BY_SOURCE_ID = "comp:redpacket:count:join:sid:";
    /**
     * Count:RedPacket:User:SourceId:
     */
    public static final String COUNT_RED_PACKET_USER_BY_SOURCE_ID = "comp:redpacket:count:user:sid:";
    /**
     * Count:RedPacket:Amount:SourceId:
     */
    public static final String COUNT_RED_PACKET_AMOUNT_BY_SOURCE_ID = "comp:redpacket:count:amount:sid:";
    /**
     * Count:RedPacket:Join:RedPacketId:
     */
    public static final String COUNT_RED_PACKET_JOIN_BY_RED_PACKET_ID = "comp:redpacket:count:join:pid:";
    /**
     * Count:RedPacket:User:RedPacketId:
     */
    public static final String COUNT_RED_PACKET_USER_BY_RED_PACKET_ID = "comp:redpacket:count:user:pid:";
    /**
     * Count:RedPacket:Amount:RedPacketId:
     */
    public static final String COUNT_RED_PACKET_AMOUNT_BY_RED_PACKET_ID = "comp:redpacket:count:amount:pid:";

    public static final String RETURN_RED_PACKET_EVENT = "RETURN_RED_PACKET";

    /**
     * 0=无限制红包
     */
    public static final Integer CONDITION_UNLIMITED = 0;
    /**
     * 2=口令红包
     */
    public static final Integer CONDITION_PASSWORD = 2;

    public static final String UNLOCK_VALUE = "1";

    /**
     * 红包金额的下边界：0   大于
     */
    public static final BigDecimal ZERO_AMOUNT = new BigDecimal("0");

    /**
     * 红包金额的上边界：   小与等于
     */
    public static final BigDecimal UPPER_AMOUNT = new BigDecimal("20000");

    /**
     * 红包数量的下边界：大于
     */
    public static final Integer ZERO_NUM = 0;

    /**
     * 红包数量的上边界：小与等于
     */
    public static final Integer UPPER_NUM = 200;

}

